<html>
<head><meta charset="utf-8"><title>meeting-2019-07-25 · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html">meeting-2019-07-25</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="171700386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700386">(Jul 25 2019 at 15:17)</a>:</h4>
<p>Hi <span class="user-group-mention" data-user-group-id="810">@WG-unsafe-code-guidelines</span> !</p>



<a name="171700401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700401">(Jul 25 2019 at 15:17)</a>:</h4>
<p>let's see who shows up this time... ;)</p>



<a name="171700407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700407">(Jul 25 2019 at 15:17)</a>:</h4>
<p>i'm here !</p>



<a name="171700427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700427">(Jul 25 2019 at 15:18)</a>:</h4>
<p>you didnt melt yet?</p>



<a name="171700494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700494">(Jul 25 2019 at 15:18)</a>:</h4>
<p>more like testing how far i can melt</p>



<a name="171700547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700547">(Jul 25 2019 at 15:19)</a>:</h4>
<p>munich is only 34C, <span class="user-mention" data-user-id="124289">@rkruppe</span> should have like almost 40C at KIT if they are there</p>



<a name="171700571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700571">(Jul 25 2019 at 15:19)</a>:</h4>
<p>pretty sure they are winning the melting competition</p>



<a name="171700578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700578">(Jul 25 2019 at 15:19)</a>:</h4>
<p>yeah 40C is also announced for Saarbrücken</p>



<a name="171700651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700651">(Jul 25 2019 at 15:20)</a>:</h4>
<p>right now its around 39</p>



<a name="171700669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700669">(Jul 25 2019 at 15:20)</a>:</h4>
<p>lucky thing is I was at a music festival last weekend, at it was like 26 or so</p>



<a name="171700686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700686">(Jul 25 2019 at 15:21)</a>:</h4>
<p>one weekend later and it would have been just pure death</p>



<a name="171700697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700697">(Jul 25 2019 at 15:21)</a>:</h4>
<p>I'm not at KIT, but it's also 39° in Darmstadt where I am :)</p>



<a name="171700709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700709">(Jul 25 2019 at 15:21)</a>:</h4>
<p>yeah there's a "stadtviertelfest" this weekend here, let's see how that goes</p>



<a name="171700714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700714">(Jul 25 2019 at 15:21)</a>:</h4>
<p>ah i thought you were at karlsruhe</p>



<a name="171700724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700724">(Jul 25 2019 at 15:21)</a>:</h4>
<p>looks like we got a German UCG mtg today? :D</p>



<a name="171700734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700734">(Jul 25 2019 at 15:21)</a>:</h4>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> Darmstadt? I grew up near Wiesbaden. ;)</p>



<a name="171700805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700805">(Jul 25 2019 at 15:22)</a>:</h4>
<p>wiesbaden is really nice for some reason</p>



<a name="171700819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700819">(Jul 25 2019 at 15:22)</a>:</h4>
<p>"for some reason"?^^</p>



<a name="171700838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700838">(Jul 25 2019 at 15:23)</a>:</h4>
<p>i was there last year, and I did not expected it to be as nice</p>



<a name="171700852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700852">(Jul 25 2019 at 15:23)</a>:</h4>
<p>hehe ;)</p>



<a name="171700863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700863">(Jul 25 2019 at 15:23)</a>:</h4>
<p>super wide streets and nice buildings, i don't know :D</p>



<a name="171700871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700871">(Jul 25 2019 at 15:23)</a>:</h4>
<p>well I wasnt actually in the city that often. but yeah the center is pretty.</p>



<a name="171700886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171700886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171700886">(Jul 25 2019 at 15:23)</a>:</h4>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> now that we got your attention, what are your thoughts on <a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/153" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/153">https://github.com/rust-lang/unsafe-code-guidelines/pull/153</a> ?</p>



<a name="171701168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701168">(Jul 25 2019 at 15:27)</a>:</h4>
<p>I haven't been able to properly form an opinion (in particular I should read what the existing chapters look like now after <span class="user-mention" data-user-id="132920">@gnzlbg</span> updated them) but my pre-existing opinion is that call ABI probably shouldn't be included in "layout" because of the existing "memory layout" connotations (and existing community practice of omitting the "memory" part) and the fact that the cases where the call ABI matters seem rather niche (sorry not sorry) compared to all the cases where it doesn't matter.</p>



<a name="171701260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701260">(Jul 25 2019 at 15:28)</a>:</h4>
<p>OTOH (a) it is included in the current def.n in master, and (b) it is included in <code>TyLayout</code> in the compiler</p>



<a name="171701302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701302">(Jul 25 2019 at 15:29)</a>:</h4>
<p>I think we discussed somewhere that we often need to distinguish size+align (e.g. for allocating memory for a <code>T</code>), size+align+niche (for allocating memory for an <code>Option&lt;T&gt;</code>), and size+layout+niche+callABI (for FFI)</p>



<a name="171701375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701375">(Jul 25 2019 at 15:30)</a>:</h4>
<p>"for FFI" - only for <em>by-value</em> FFI, not behind pointers, which is another good example of call ABI rarely mattering</p>



<a name="171701387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701387">(Jul 25 2019 at 15:30)</a>:</h4>
<p>yes, by value FFI</p>



<a name="171701402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701402">(Jul 25 2019 at 15:30)</a>:</h4>
<p>for memory FFI, we usually only care about size+align, not even niches, since C doesn't have those</p>



<a name="171701410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701410">(Jul 25 2019 at 15:30)</a>:</h4>
<p>We definitely need terms for all three but if we have "layout" without qualifications, it should roughly match e.g. how everyone talks about <code>transmute</code> being OK or not</p>



<a name="171701416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701416">(Jul 25 2019 at 15:30)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> and fields</p>



<a name="171701453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701453">(Jul 25 2019 at 15:31)</a>:</h4>
<p>its hard for me to articulate when do we care about fields</p>



<a name="171701454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701454">(Jul 25 2019 at 15:31)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> Niches don't matter directly/at the top level but the niche of <code>T</code> matters e.g. for whether <code>Option&lt;T&gt;</code> is sensible to pass by value in FFI</p>



<a name="171701463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701463">(Jul 25 2019 at 15:31)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> well we care that they are at the same offset in Rust and C</p>



<a name="171701472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701472">(Jul 25 2019 at 15:31)</a>:</h4>
<p>i mean, the C code will need to respect whatever niches are in the Rust memory, if the Rust memory uses those</p>



<a name="171701541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701541">(Jul 25 2019 at 15:32)</a>:</h4>
<p>(or the other way around, Rust cannot use type with niches)</p>



<a name="171701562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701562">(Jul 25 2019 at 15:33)</a>:</h4>
<p>so for FFI and transmutes in Rust we care about fields and niches</p>



<a name="171701586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701586">(Jul 25 2019 at 15:33)</a>:</h4>
<p>size+align, size+align+fields+niches, and ...+callABI for by value FFI</p>



<a name="171701652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701652">(Jul 25 2019 at 15:34)</a>:</h4>
<p>size+align+niche is what matters for inner types when computing the layout of the outer type</p>



<a name="171701672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701672">(Jul 25 2019 at 15:34)</a>:</h4>
<p>and size+align+niche+fields is required to transmute between two types</p>



<a name="171701701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701701">(Jul 25 2019 at 15:35)</a>:</h4>
<p>niche actually isnt</p>



<a name="171701716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701716">(Jul 25 2019 at 15:35)</a>:</h4>
<p>like you can transmute an <code>&amp;T</code> to a <code>*const T</code> just fine</p>



<a name="171701728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701728">(Jul 25 2019 at 15:35)</a>:</h4>
<p>you can't transmute an Option&lt;&amp;T&gt; into a &amp;T if the value of the option is None</p>



<a name="171701743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701743">(Jul 25 2019 at 15:35)</a>:</h4>
<p>If you start distingushing the directions, alignment also matters partially</p>



<a name="171701789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701789">(Jul 25 2019 at 15:36)</a>:</h4>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> why that? its by-value</p>



<a name="171701792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701792">(Jul 25 2019 at 15:36)</a>:</h4>
<p>alignment doesn't matter for transmute right?</p>



<a name="171701805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701805">(Jul 25 2019 at 15:36)</a>:</h4>
<p>Oh right, not for transmute, I was thinking of type punning memory in-place</p>



<a name="171701851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701851">(Jul 25 2019 at 15:37)</a>:</h4>
<p>like going from a <code>*const T</code> to a <code>*const U</code> where the alignment doesn't match exactly ?</p>



<a name="171701868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701868">(Jul 25 2019 at 15:37)</a>:</h4>
<p>(e.g. if the alignment of T is 4 but the alignment of U is 2)</p>



<a name="171701916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701916">(Jul 25 2019 at 15:38)</a>:</h4>
<p>Yes, stuff like that</p>



<a name="171701934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701934">(Jul 25 2019 at 15:38)</a>:</h4>
<p>So what if we just mention in the glossary all layout components and explain them, but in the guarantees we stop using the term layout, and mention exactly what's guaranteed ?</p>



<a name="171701941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701941">(Jul 25 2019 at 15:38)</a>:</h4>
<p>you can still <code>read_unaligned</code>, but yes</p>



<a name="171701988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701988">(Jul 25 2019 at 15:39)</a>:</h4>
<p>e.g. instead of saying the layout of T is the same as that of U, we'll say the size+align+fields+niche+callABI of T is the same as that of U</p>



<a name="171701991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171701991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171701991">(Jul 25 2019 at 15:39)</a>:</h4>
<p>I tend to agree, "same layout" is just way too ambiguous as a term</p>



<a name="171702001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702001">(Jul 25 2019 at 15:39)</a>:</h4>
<p>Agreed.</p>



<a name="171702004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702004">(Jul 25 2019 at 15:39)</a>:</h4>
<p>I would be open though to having explicitly qualified shortcuts for common combinations</p>



<a name="171702081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702081">(Jul 25 2019 at 15:40)</a>:</h4>
<p>"full layout" = all of it, "memory layout" = this+that, ...<br>
we shouldn't have too many, but say the two most common or so might make sense</p>



<a name="171702106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702106">(Jul 25 2019 at 15:40)</a>:</h4>
<p>Seems fine, but this is editorial polish IMO, nothing to prioritize now.</p>



<a name="171702119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702119">(Jul 25 2019 at 15:41)</a>:</h4>
<p>agreed</p>



<a name="171702129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702129">(Jul 25 2019 at 15:41)</a>:</h4>
<p>maybe we can just say layout (SA), or layout (SAFNC) or similar, we can do that later when the correct things are written down</p>



<a name="171702138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702138">(Jul 25 2019 at 15:41)</a>:</h4>
<p>do we have unique first letters?</p>



<a name="171702149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702149">(Jul 25 2019 at 15:41)</a>:</h4>
<p>size, align, field, niche, callabi... seems like it. even if we add "(un)inhabitedness" one day.</p>



<a name="171702208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702208">(Jul 25 2019 at 15:42)</a>:</h4>
<p>if we wanted to include padding we would use P</p>



<a name="171702222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702222">(Jul 25 2019 at 15:42)</a>:</h4>
<p>though if we do that we should agree on a consistent ordering</p>



<a name="171702238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702238">(Jul 25 2019 at 15:42)</a>:</h4>
<p>I dont want to have to scan if CNSAF and SAFNC are the same^^</p>



<a name="171702254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702254">(Jul 25 2019 at 15:42)</a>:</h4>
<p>I'll open an issue to track this, documenting what we have discussed here</p>



<a name="171702266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702266">(Jul 25 2019 at 15:42)</a>:</h4>
<p>or just update the PR? :D</p>



<a name="171702300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702300">(Jul 25 2019 at 15:43)</a>:</h4>
<p>i'll update the PR to expand things, but i mean, for the abbreviations, or adding new terms for the common uses</p>



<a name="171702309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702309">(Jul 25 2019 at 15:43)</a>:</h4>
<p>you already opened an issue to track "pushing through a changed def.n of layout"</p>



<a name="171702314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702314">(Jul 25 2019 at 15:43)</a>:</h4>
<p>seems like the same issue?</p>



<a name="171702415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702415">(Jul 25 2019 at 15:44)</a>:</h4>
<p>but either way, seems fine to me</p>



<a name="171702425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702425">(Jul 25 2019 at 15:44)</a>:</h4>
<p>next oldest PR: <a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/154" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/154">https://github.com/rust-lang/unsafe-code-guidelines/pull/154</a></p>



<a name="171702443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702443">(Jul 25 2019 at 15:44)</a>:</h4>
<p>that was more about making niche and call ABI a part of layout, but we are punting the work of coming up with some abbreviations to avoid repeating stuff, I can reuse that issue for that</p>



<a name="171702452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702452">(Jul 25 2019 at 15:44)</a>:</h4>
<p>I think I'll just merge that one? <span class="user-mention" data-user-id="124289">@rkruppe</span> ?</p>



<a name="171702494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702494">(Jul 25 2019 at 15:45)</a>:</h4>
<p>while we could merge this <span class="user-mention" data-user-id="133214">@briansmith</span> raises a good point</p>



<a name="171702515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702515">(Jul 25 2019 at 15:45)</a>:</h4>
<p>why is this called "unsafe code guidelines" ?</p>



<a name="171702530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702530">(Jul 25 2019 at 15:45)</a>:</h4>
<p>because <span class="user-mention" data-user-id="116009">@nikomatsakis</span> called it that way^^</p>



<a name="171702538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702538">(Jul 25 2019 at 15:45)</a>:</h4>
<p>eventually the hope is we can produce guidelines for unsafe code authors to follow</p>



<a name="171702539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702539">(Jul 25 2019 at 15:45)</a>:</h4>
<p>sounds like we wanted to provide some general guidelines for unsafe code to rely on, but this is turned into groundwork for a full blown language spec</p>



<a name="171702602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702602">(Jul 25 2019 at 15:46)</a>:</h4>
<p>because its hard to give guidelines that we can commit to without any kind of spec...</p>



<a name="171702608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702608">(Jul 25 2019 at 15:46)</a>:</h4>
<p>with all the drafts about an aliasing model, memory model, mir model maybe in the future</p>



<a name="171702642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702642">(Jul 25 2019 at 15:46)</a>:</h4>
<p>so this is more like a "reference-evolution" working group</p>



<a name="171702672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702672">(Jul 25 2019 at 15:47)</a>:</h4>
<p>where we prepare things that we want to specify in the reference, that aren't necessarily new language features per se</p>



<a name="171702685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702685">(Jul 25 2019 at 15:47)</a>:</h4>
<p>and prepare RFCs for those, push them through the process, and then update the reference proper</p>



<a name="171702686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702686">(Jul 25 2019 at 15:47)</a>:</h4>
<p>well maybe at some point someone will join us who enjoys writing documents explaining "do this, dont do that". but other people outside the WG are already doing that (e.g. with MaybeUninit, or RustSec).</p>



<a name="171702787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702787">(Jul 25 2019 at 15:48)</a>:</h4>
<p>and we are also the go-to place when people ask "can unsafe code do this or rely on that"</p>



<a name="171702793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702793">(Jul 25 2019 at 15:48)</a>:</h4>
<p>so there's some amount of unsafe code guidance in what we do</p>



<a name="171702799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702799">(Jul 25 2019 at 15:48)</a>:</h4>
<p>usually you would ask the spec for that</p>



<a name="171702810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702810">(Jul 25 2019 at 15:49)</a>:</h4>
<p>sure</p>



<a name="171702814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702814">(Jul 25 2019 at 15:49)</a>:</h4>
<p>or the rust reference in this case</p>



<a name="171702823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702823">(Jul 25 2019 at 15:49)</a>:</h4>
<p>well you'd ask someone who read and understood the spec ;)</p>



<a name="171702838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702838">(Jul 25 2019 at 15:49)</a>:</h4>
<p>i don't know, I felt like <span class="user-mention" data-user-id="133214">@briansmith</span> concern that that particular PR has not much to do with unsafe code is correct</p>



<a name="171702859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702859">(Jul 25 2019 at 15:50)</a>:</h4>
<p>I don't have a strong opinion on <a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/154" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/154">https://github.com/rust-lang/unsafe-code-guidelines/pull/154</a> but let's say I would not have suggested writing this up in UCG if someone has asked me beforehand.</p>



<a name="171702860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702860">(Jul 25 2019 at 15:50)</a>:</h4>
<p>it is completely in line with the other things in that file though</p>



<a name="171702912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702912">(Jul 25 2019 at 15:50)</a>:</h4>
<p>But yes it's in line with the other C standard interactions and sizes of types and so on we discuss</p>



<a name="171702932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702932">(Jul 25 2019 at 15:50)</a>:</h4>
<p>Mostly I think the point is this could be more useful elsewhere. Which doesn't make it useless here, but still a good point</p>



<a name="171702936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702936">(Jul 25 2019 at 15:50)</a>:</h4>
<p>okay I am going to merge then</p>



<a name="171702954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702954">(Jul 25 2019 at 15:51)</a>:</h4>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> any idea what "elsewhere" might be?</p>



<a name="171702960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702960">(Jul 25 2019 at 15:51)</a>:</h4>
<p>ok, so I will open an issue in the reference to track down writing this somewhere else</p>



<a name="171702972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171702972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171702972">(Jul 25 2019 at 15:51)</a>:</h4>
<p>Either reference or stdlib docs seems good</p>



<a name="171703037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703037">(Jul 25 2019 at 15:52)</a>:</h4>
<p>like the docs of the <code>isize</code>/<code>usize</code> type?</p>



<a name="171703048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703048">(Jul 25 2019 at 15:52)</a>:</h4>
<p>eventually the plan is for the WG to move towards "upstreaming things we agree on into RFCs/docs", I guess that would be part of this</p>



<a name="171703071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703071">(Jul 25 2019 at 15:53)</a>:</h4>
<p>Yes, on the types. Or perhaps on the trait impls that are justified by this observation.</p>



<a name="171703076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703076">(Jul 25 2019 at 15:53)</a>:</h4>
<p>seems reasonable</p>



<a name="171703082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703082">(Jul 25 2019 at 15:53)</a>:</h4>
<p>I personally just dont care enough about those things to push for it ;)</p>



<a name="171703157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703157">(Jul 25 2019 at 15:54)</a>:</h4>
<p>next PR, and last for today because the mtg is already ~10min over: <a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/162" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/162">https://github.com/rust-lang/unsafe-code-guidelines/pull/162</a></p>



<a name="171703166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703166">(Jul 25 2019 at 15:54)</a>:</h4>
<p>seems like an obvious statement, I guess my only question is "is this worth stating"^^</p>



<a name="171703332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703332">(Jul 25 2019 at 15:57)</a>:</h4>
<p>Doesn't hurt, merge it</p>



<a name="171703381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703381">(Jul 25 2019 at 15:58)</a>:</h4>
<p>At some point we'll have to follow up to the stride!=size matter that broke out in that thread but let's not punish the nice note for that</p>



<a name="171703384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703384">(Jul 25 2019 at 15:58)</a>:</h4>
<p>yay, we're like.. 25% through <span class="user-mention" data-user-id="132920">@gnzlbg</span>'s attempt at DoSing us with a dozen PRs ;)</p>



<a name="171703437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703437">(Jul 25 2019 at 15:58)</a>:</h4>
<blockquote>
<p>At some point we'll have to follow up to the stride!=size matter that broke out in that thread but let's not punish the nice note for that</p>
</blockquote>
<p>yeah</p>



<a name="171703442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703442">(Jul 25 2019 at 15:58)</a>:</h4>
<p>I think the general feeling is that it will be good to have a chapter somewhere in the layout section summarizing zero-sized types</p>



<a name="171703452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703452">(Jul 25 2019 at 15:58)</a>:</h4>
<p>I am actually not sure about that any more</p>



<a name="171703458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703458">(Jul 25 2019 at 15:58)</a>:</h4>
<p>i think the nomicon has a chapter on exotically sized types, including zero-sized, unsized, etc.</p>



<a name="171703500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703500">(Jul 25 2019 at 15:59)</a>:</h4>
<p>I'll open an issue to track removing the stride != size stuff</p>



<a name="171703786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703786">(Jul 25 2019 at 16:02)</a>:</h4>
<p>so we are done for today</p>



<a name="171703846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703846">(Jul 25 2019 at 16:03)</a>:</h4>
<p>we are. this was productive. thanks all!</p>



<a name="171703937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703937">(Jul 25 2019 at 16:04)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> your last PR adds definitions for value / place +- expression . I think it would be nice if more people could review that, e.g., <span class="user-mention" data-user-id="125253">@Nicole Mazzuca</span> and <span class="user-mention" data-user-id="124289">@rkruppe</span> for example.</p>



<a name="171703957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171703957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171703957">(Jul 25 2019 at 16:04)</a>:</h4>
<p>wait why does that PR have 64 comments already?</p>



<a name="171704131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171704131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171704131">(Jul 25 2019 at 16:07)</a>:</h4>
<p>because <span class="user-mention" data-user-id="126931">@centril</span>  found it^^</p>



<a name="171704223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171704223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171704223">(Jul 25 2019 at 16:08)</a>:</h4>
<p>I'll gladly review/approve (took a quick look already and seems good) the glossary changes but it's impossible for me to keep up with the discussion of the other stuff. So if you split out the glossary change, it can be merged much sooner :)</p>



<a name="171704353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171704353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171704353">(Jul 25 2019 at 16:10)</a>:</h4>
<p>yeah I was wondering about that</p>



<a name="171704359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171704359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171704359">(Jul 25 2019 at 16:10)</a>:</h4>
<p>I should probably do that, though it will lose the comments for that part</p>



<a name="171704364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171704364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171704364">(Jul 25 2019 at 16:10)</a>:</h4>
<p>the split sounds good to me</p>



<a name="171704368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171704368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171704368">(Jul 25 2019 at 16:10)</a>:</h4>
<p>you can keep them in the WIP PR until those changes are merged</p>



<a name="171704408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171704408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171704408">(Jul 25 2019 at 16:11)</a>:</h4>
<p>argh is it just me or does GH often time out recently when you click through its UI, and you have to re-load the entire page to get it working again?</p>



<a name="171705611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171705611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171705611">(Jul 25 2019 at 16:28)</a>:</h4>
<p>btw <span class="user-mention" data-user-id="132920">@gnzlbg</span> <a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/160" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/160">https://github.com/rust-lang/unsafe-code-guidelines/pull/160</a> has some outstanding comments</p>



<a name="171705653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171705653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171705653">(Jul 25 2019 at 16:29)</a>:</h4>
<p>yep, I don't know what to do about the padding one yet</p>



<a name="171705657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171705657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171705657">(Jul 25 2019 at 16:29)</a>:</h4>
<p>padding is not part of layout</p>



<a name="171705680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171705680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171705680">(Jul 25 2019 at 16:30)</a>:</h4>
<p>right now we informally call  the unused space between fields "padding"</p>



<a name="171705756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171705756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171705756">(Jul 25 2019 at 16:30)</a>:</h4>
<p>unions do not have unused space between fields</p>



<a name="171705772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171705772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171705772">(Jul 25 2019 at 16:30)</a>:</h4>
<p>or at least <code>repr(C)</code> unions do not, because all fields start at offset 0</p>



<a name="171705817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171705817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171705817">(Jul 25 2019 at 16:31)</a>:</h4>
<p>I'd just drop the new paragraph on padding</p>



<a name="171705818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171705818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171705818">(Jul 25 2019 at 16:31)</a>:</h4>
<p>trailing padding is clear, in that there is unused space after the last field</p>



<a name="171705919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171705919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171705919">(Jul 25 2019 at 16:32)</a>:</h4>
<p>and the ZST statement again is of the kind "is that worth stating"? I mean why would they <em>not</em> participate with their alginment, and why would anyone assume that? doesn't warrant 15-20 lines of text IMO.</p>



<a name="171706172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171706172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171706172">(Jul 25 2019 at 16:36)</a>:</h4>
<p>I'd assume that, unless otherwise guaranteed, the behavior of using a ZST field in a <code>repr(C)</code> struct or union is undefined on FFI (and unspecified otherwise)</p>



<a name="171706191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171706191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171706191">(Jul 25 2019 at 16:37)</a>:</h4>
<p>Because the general definition of <code>repr(C)</code> is "do what C does" and in C this cannot happen</p>



<a name="171706413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171706413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171706413">(Jul 25 2019 at 16:40)</a>:</h4>
<p>the text is written as if the default assumption was "the compiler just ignores them"</p>



<a name="171706438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171706438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171706438">(Jul 25 2019 at 16:40)</a>:</h4>
<p>that is the only way I can interpret "(ZST) fields participate in layout computation". I mean, <em>of course</em> they do.</p>



<a name="171706460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171706460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171706460">(Jul 25 2019 at 16:40)</a>:</h4>
<p><a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/161" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/161">https://github.com/rust-lang/unsafe-code-guidelines/pull/161</a> is also blocked on talking about padding; these PRs are too early IMO, we don't have enough data/information/definitions to form an informed consensus there</p>



<a name="171713457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171713457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171713457">(Jul 25 2019 at 18:13)</a>:</h4>
<blockquote>
<p>because @centril found it^^</p>
</blockquote>
<p>fwiw, I was pointed to it ;)</p>



<a name="171715947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171715947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171715947">(Jul 25 2019 at 18:41)</a>:</h4>
<p>ah, who's the traitor? :P</p>



<a name="171718207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171718207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171718207">(Jul 25 2019 at 19:09)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> I think <a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/163/files" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/163/files">https://github.com/rust-lang/unsafe-code-guidelines/pull/163/files</a> is basically read to be merged except for that one wording change</p>



<a name="171727523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171727523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171727523">(Jul 25 2019 at 21:01)</a>:</h4>
<blockquote>
<p>ah, who's the traitor? :P</p>
</blockquote>
<p>I was forced to point it to them because you wrote "operational semantics" in it in a heading and I thought "Centril is into that"</p>



<a name="171732924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171732924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171732924">(Jul 25 2019 at 22:26)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="171738018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171738018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171738018">(Jul 26 2019 at 00:08)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> meeting is over, but I am a person who loves to write the "do this don't do that" documents</p>



<a name="171738058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171738058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171738058">(Jul 26 2019 at 00:09)</a>:</h4>
<p>one new unsafe group recently is the Safety Dance <a href="https://github.com/rust-secure-code/safety-dance" target="_blank" title="https://github.com/rust-secure-code/safety-dance">https://github.com/rust-secure-code/safety-dance</a></p>



<a name="171752175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171752175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171752175">(Jul 26 2019 at 06:59)</a>:</h4>
<p><span class="user-mention" data-user-id="224471">@Lokathor</span> great!<br>
I guess the question is which kinds of "do this dont do that" documents are the most useful? The first coming to my mind is basic stuff around unsafe and UB, around obligations and who is trusting whom to get what right -- to avoid <a href="https://users.rust-lang.org/t/how-to-create-a-long-array-with-non-copyable-element/30280" target="_blank" title="https://users.rust-lang.org/t/how-to-create-a-long-array-with-non-copyable-element/30280">discussions like this</a>, and to promote a style where every unsafe block is accompanied by a comment explaining why this is not UB (neither now nor later -- see <code>Vec::set_len</code>, sometimes unsafe operations are bad even if they do not cause immediate UB).<br>
but the nomicon already covers some of this.</p>



<a name="171752834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171752834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171752834">(Jul 26 2019 at 07:14)</a>:</h4>
<p>The whole discussion in that thread is in a sense funny because <em>clearly</em> the best way to make 26 blank vecs in an array is to use</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">v</span>: <span class="nb">Vec</span><span class="o">&lt;</span><span class="kt">u8</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Vec</span>::<span class="n">new</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">v_bytes</span>: <span class="p">[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="mi">24</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">unsafe</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">core</span>::<span class="n">mem</span>::<span class="n">transmute</span><span class="p">(</span><span class="n">v</span><span class="p">)</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">array_of_vecs</span>: <span class="p">[[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="mi">24</span><span class="p">];</span><span class="w"> </span><span class="mi">26</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="n">v_bytes</span><span class="p">;</span><span class="w"> </span><span class="mi">26</span><span class="p">];</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">final_vecs</span>: <span class="p">[</span><span class="nb">Vec</span><span class="o">&lt;</span><span class="kt">u8</span><span class="o">&gt;</span><span class="p">;</span><span class="w"> </span><span class="mi">26</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">unsafe</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">core</span>::<span class="n">mem</span>::<span class="n">transmute</span><span class="p">(</span><span class="n">array_of_vecs</span><span class="p">)</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="w">    </span><span class="n">println</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;{:?}&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">final_vecs</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>And then you don't need uninitialized or MaybeUninit at all.</p>



<a name="171753339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171753339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171753339">(Jul 26 2019 at 07:26)</a>:</h4>
<p>btw <span class="user-mention" data-user-id="224471">@Lokathor</span> our regular meeting time is Thursdays 15:15 UTC (anchored to New York time, so we shift by 1h as DST starts/ends there), the intended length is 30min, and the usual idea is to not discuss content but process -- in particular, which PRs to merge, which PRs/issues to close/open.</p>



<a name="171753440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171753440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171753440">(Jul 26 2019 at 07:28)</a>:</h4>
<p><span class="user-mention" data-user-id="224471">@Lokathor</span> I would not call that the best way... also I am not even sure if you are entirely serious^^ but in case you are, (a) this only works on 64bit, (b) this breaks even there when <code>Vec</code> changes size; (c) this is UB if <code>Vec</code> ever has padding.</p>



<a name="171753457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171753457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171753457">(Jul 26 2019 at 07:29)</a>:</h4>
<p>(d) this relies on <code>Vec::new</code> implementation details</p>



<a name="171753555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171753555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171753555">(Jul 26 2019 at 07:31)</a>:</h4>
<p>It's possible I could be present for the next one if you like. That's around 9am for me, which isn't unreasonable given the rest of my schedule lately. However, I'm not sure I'd be much help at PR/issue triage for UCG.</p>



<a name="171753734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171753734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171753734">(Jul 26 2019 at 07:34)</a>:</h4>
<p>As to the vec thing, (a) you could use size_of or you could call it a feature that the code stops compiling when the unexpected happens. (b) the standard library says "Due to its incredibly fundamental nature, Vec makes a lot of guarantees about its design.  ... Most fundamentally, Vec is and always will be a (pointer, capacity, length) triplet. No more, no less." (c) I don't understand your meaning. (d) I can live with that, and since Vec::new is on track to even become <code>const</code> I can extra live with that. I wouldn't tell people to do it for every possible type, just for Vecs and other <em>very well understood and specified</em> types.</p>



<a name="171753819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171753819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171753819">(Jul 26 2019 at 07:36)</a>:</h4>
<p>I was mildly serious: I would always rather do a transmute dance or a plain and simple zeroed than deal with a single bit of uninit in any form. Perhaps that's just my personal style</p>



<a name="171755599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171755599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171755599">(Jul 26 2019 at 08:11)</a>:</h4>
<blockquote>
<p>It's possible I could be present for the next one if you like. That's around 9am for me, which isn't unreasonable given the rest of my schedule lately. However, I'm not sure I'd be much help at PR/issue triage for UCG.</p>
</blockquote>
<p>up to you, I just mentioned that in case you'd be interested. :)</p>



<a name="171755681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25/near/171755681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/meeting-2019-07-25.html#171755681">(Jul 26 2019 at 08:13)</a>:</h4>
<p>(c) is basically also resolved by your answer to (b), but what I mean is that given <code>(u8, u16)</code>, a transmute to <code>[u8; 4]</code> is UB because there is an uninitialized byte here: the padding byte.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>